package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.Orders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Title: AdminOrderMapper
 * @Author 贾金博
 * @Package com.sky.mapper
 * @Date 2024/3/30 20:40
 * @description:
 */
@Mapper
public interface AdminOrderMapper {
    /**
     * 查询全部的订单
     * @param orders
     * @return
     */
    Page<Orders> findAllOrders(OrdersPageQueryDTO orders);


    /**
     * 查询各个状态的数量
     * @param confirmed
     * @return
     */
    @Select("select count(*) from orders where status = #{status}")
    Integer getOrdersByStatus(Integer confirmed);
}
